<?xml version="1.0" encoding="utf-8" ?>
<taskrunner name="restore.configuration" version="1.1" date="2008-10-30" maxthreads="1">

  <!-- 
    Copies configuration files from the vidasave directory to the runtime directories.
    The configuration files are copied to the vidasave directory during unistall of vida.
    If any of the configuration files does not exist in the vidasave directory the
    global property ¤{restore.configuration.ok} will be set to false.
  -->

  <includes>
    <file name="vida.install.settings.xml" />
  </includes>

  <tasks>

    
    <task name="set.restore.ok.false" typename="@SetGlobalProperty">
      <description>
        Default value restore.configuration.ok=false
      </description>
      <dependencies list=""/>
      <parameters>
        <parameter name="property.name" value="restore.configuration.ok"/>
        <parameter name="property.value" value="false"/>
      </parameters>
    </task>
    
    <foreach enum="config.files">
      <task name="restore" typename="@FileCopy" allowMultipleInstances="true">
        <description>
          Restores components.config.xml
        </description>
        <errormessage>
          Could not restore the file $[config.files:key]
        </errormessage>
        <dependencies list="set.restore.ok.false"/>
        <parameters>
          <parameter name="src" value="$[config.files:source.dir]\$[config.files:key]"/>
          <parameter name="dst" value="$[config.files:target.dir]\$[config.files:key]"/>
          <parameter name="throwException" value="true"/>
          
        </parameters>
      </task>
    </foreach>
        
   
    
    

    <task name="set.restore.ok.true" typename="@SetGlobalProperty">
      <description>
        All files copied ok -> set restore.configuration.ok=true
      </description>
      <dependencies list="restore"/>
      <parameters>
        <parameter name="property.name" value="restore.configuration.ok"/>
        <parameter name="property.value" value="true"/>
      </parameters>
    </task>
    
  </tasks>
</taskrunner>